#include "key_new.h"

uint8_t Key_Val = 0;
uint8_t Key_Down = 0;
uint8_t Key_Up = 0;
uint8_t Key_Old = 0;

uint8_t Key_Scan(void)
{
	uint8_t temp = 0;
	if(HAL_GPIO_ReadPin(GPIOB, GPIO_PIN_3) == 0)
	{
		temp = 0;
	}
	else if(HAL_GPIO_ReadPin(GPIOB, GPIO_PIN_1) == 0)
	{
		temp = 1;
	}
	return temp;
}

void Key_New_Proc(void)
{
	Key_Val = Key_Scan();
	Key_Down = Key_Val & (Key_Val^Key_Old);
	Key_Up = ~Key_Val & (Key_Val^Key_Old);
	Key_Old = Key_Val;
}
